package com.zhentao.controller;

import com.github.pagehelper.PageHelper;
import com.zhentao.model.common.business.dto.BusinessShopTypeDto;
import com.zhentao.model.common.business.pojo.BusinessShop;
import com.zhentao.model.common.business.pojo.BusinessShopType;
import com.zhentao.model.common.dtos.ResponseResult;
import com.zhentao.service.BusinessShopTypeService;
import io.swagger.annotations.ApiOperation;
import org.springframework.http.HttpRequest;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

@RestController
@RequestMapping("/type")
public class BusinessShopTypeController {
    @Resource
    private BusinessShopTypeService businessShopTypeService;


//    @GetMapping("/oo")
//    public ResponseResult oo(@RequestBody MultipartFile file){
//        System.out.println(file);
//       return ResponseResult.okResult(11);
//    }


    /**
     * 店铺分类列表
     */
    @GetMapping("/selShopTypeList")
    @ApiOperation("店铺分类列表")
    public ResponseResult selShopTypeList(BusinessShopTypeDto businessShopTypeDto){
        return businessShopTypeService.selShopTypeList(businessShopTypeDto);
    }

    @GetMapping("/shopTypeList")
    @ApiOperation("店铺分类列表无分页")
    public ResponseResult shopTypeList(){
        return businessShopTypeService.shopTypeList();
    }

    /**
     * 店铺分类添加
     */
    @PostMapping("/addShopType")
    @ApiOperation("店铺分类添加")
    public ResponseResult addShopType(@RequestBody BusinessShopType businessShopType){
        return businessShopTypeService.addShopType(businessShopType);
    }

    /**
     * 店铺分类修改
     */
    @PostMapping("/updShopType")
    @ApiOperation("店铺分类修改")
    public ResponseResult updShopType(@RequestBody BusinessShopType businessShopType){
        return businessShopTypeService.updShopType(businessShopType);
    }

    /**
     * 店铺分类删除
     */
    @GetMapping("/delShopType")
    @ApiOperation("店铺分类删除")
    public ResponseResult delShopType(@RequestParam Integer id){
        return businessShopTypeService.delShopType(id);
    }


}
